home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AEsquareSrfTemplate.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  5.4 KB  |  184 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //    Alias|Wavefront Script File
  19. //
  20. //    Creation Date:    Sept. 22, 1998
  21. //    Author:            mgr
  22. //
  23. //    Procedure Name:
  24. //    AEsquareSrfTemplate
  25. //
  26. //    Description Name;
  27. //    Creates the attribute editor controls for the square surface node
  28. //
  29. //    Input Value:
  30. //    nodeName
  31. //
  32. //    Output Value:
  33. //    None
  34. //
  35.  
  36. global proc AEcontinuityPassedNew( string $plug )
  37. {
  38.     setUITemplate -pst attributeEditorTemplate;
  39.  
  40.     checkBoxGrp -editable false -ncb 1 -l ""
  41.         -l1 "Continuity Passed 1"
  42.         contPassedChecks1;
  43.  
  44.     checkBoxGrp -editable false -ncb 1 -l ""
  45.         -l1 "Continuity Passed 2"
  46.         contPassedChecks2;
  47.  
  48.     checkBoxGrp -editable false -ncb 1 -l ""
  49.         -l1 "Continuity Passed 3"
  50.         contPassedChecks3;
  51.  
  52.     checkBoxGrp -editable false -ncb 1 -l ""
  53.         -l1 "Continuity Passed 4"
  54.         contPassedChecks4;
  55.  
  56.     setUITemplate -ppt;
  57.  
  58.     AEcontinuityPassedReplace $plug;
  59. }
  60.  
  61. global proc AEcontinuityPassedReplace( string $plug )
  62. {
  63.     string $multiPlugName = $plug + "1";
  64.     connectControl -in 2 contPassedChecks1 $multiPlugName;
  65.     $multiPlugName = $plug + "2";
  66.     connectControl -in 2 contPassedChecks2 $multiPlugName;
  67.     $multiPlugName = $plug + "3";
  68.     connectControl -in 2 contPassedChecks3 $multiPlugName;
  69.     $multiPlugName = $plug + "4";
  70.     connectControl -in 2 contPassedChecks4 $multiPlugName;
  71.  
  72.     int $passed;
  73.     $passed = `getAttr ($plug + "1")`;
  74.     checkBoxGrp -e -v1 $passed contPassedChecks1;
  75.     $passed = `getAttr ($plug + "2")`;
  76.     checkBoxGrp -e -v1 $passed contPassedChecks2;
  77.     $passed = `getAttr ($plug + "3")`;
  78.     checkBoxGrp -e -v1 $passed contPassedChecks3;
  79.     $passed = `getAttr ($plug + "4")`;
  80.     checkBoxGrp -e -v1 $passed contPassedChecks4;
  81. }
  82.  
  83. global proc AEsquareSrfTemplate( string $nodeName )
  84. {
  85.  
  86.     editorTemplate -beginScrollLayout;
  87.  
  88.         editorTemplate -beginLayout "Square Surface History" -collapse false;
  89.             
  90.             editorTemplate -callCustom "AEinputNew \"Input Curve 1\""
  91.                         "AEinputReplace \"Input Curve 1\""
  92.                         "inputCurve1";
  93.             editorTemplate -callCustom "AEinputNew \"Input Curve 2\""
  94.                         "AEinputReplace \"Input Curve 2\""
  95.                         "inputCurve2";
  96.             editorTemplate -callCustom "AEinputNew \"Input Curve 3\""
  97.                         "AEinputReplace \"Input Curve 3\""
  98.                         "inputCurve3";
  99.             editorTemplate -callCustom "AEinputNew \"Input Curve 4\""
  100.                         "AEinputReplace \"Input Curve 4\""
  101.                         "inputCurve4";
  102.  
  103.             editorTemplate -addControl "endPointTolerance";
  104.  
  105.             editorTemplate -beginLayout "Rebuild Curve";
  106.                 editorTemplate -addControl "rebuildCurve1";
  107.                 editorTemplate -addControl "rebuildCurve2";
  108.                 editorTemplate -addControl "rebuildCurve3";
  109.                 editorTemplate -addControl "rebuildCurve4";
  110.             editorTemplate -endLayout;
  111.  
  112.         editorTemplate -beginLayout "Continuity";
  113.             editorTemplate -beginLayout "Continuity Type";
  114.                 editorTemplate -label "Continuity Type 1" -addControl "continuityType1";
  115.                 editorTemplate -label "Continuity Type 2" -addControl "continuityType2";
  116.                 editorTemplate -label "Continuity Type 3" -addControl "continuityType3";
  117.                 editorTemplate -label "Continuity Type 4" -addControl "continuityType4";
  118.             editorTemplate -endLayout;
  119.  
  120.             editorTemplate -beginLayout "Continuity Passed";
  121.                 editorTemplate -callCustom "AEcontinuityPassedNew"
  122.                     "AEcontinuityPassedReplace" 
  123.                     "continuityPassed";
  124.             editorTemplate -endLayout;
  125.  
  126.             editorTemplate -addControl "curveFitCheckpoints" 
  127.                                 "curveFitCheckpointsControls";
  128.  
  129.         editorTemplate -endLayout;
  130.  
  131.         editorTemplate -endLayout;
  132.  
  133.     // include/call base class/node attributes
  134.     AEabstractBaseCreateTemplate $nodeName;
  135.  
  136.     editorTemplate -addExtraControls;
  137.     editorTemplate -endScrollLayout;
  138.  
  139.     editorTemplate -suppress "inputCurve1";
  140.     editorTemplate -suppress "inputCurve2";
  141.     editorTemplate -suppress "inputCurve3";
  142.     editorTemplate -suppress "inputCurve4";
  143.  
  144. }
  145.  
  146. global proc curveFitCheckpointsControls( string $nodeName )
  147. {
  148.     // dim the curve fit checkpoints control if none of the input
  149.     // curves have tangent continuity type
  150.     //
  151.  
  152.     string $contTypeAtt = $nodeName + ".continuityType1";
  153.     string $contTypes[4];
  154.     $contTypes[0] = "continuityType1";
  155.     $contTypes[1] = "continuityType2";
  156.     $contTypes[2] = "continuityType3";
  157.     $contTypes[3] = "continuityType4";
  158.     int $numTypes = size($contTypes);
  159.     int $haveContinuity = 0;
  160.     int $i;
  161.  
  162.     string $nodeTypeName;
  163.     int $type;
  164.     for ( $i = 0; $i < $numTypes; $i++ )
  165.     {
  166.         $nodeTypeName = $nodeName + "." + $contTypes[$i];
  167.         $type = `getAttr $nodeTypeName`;
  168.         if ( $type == 2 )
  169.         {
  170.             $haveContinuity = 1;
  171.             break;
  172.         }
  173.     }
  174.  
  175.     if ( $haveContinuity )
  176.     {
  177.         editorTemplate -dimControl $nodeName "curveFitCheckpoints" false;
  178.     }
  179.     else
  180.     {
  181.         editorTemplate -dimControl $nodeName "curveFitCheckpoints" true;
  182.     }
  183. }
  184.